home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 3
/
Cream of the Crop 3.iso
/
clipper
/
ks94an.zip
/
APPXEQUA.HDR
< prev
next >
Wrap
Text File
|
1994-04-25
|
1KB
|
49 lines
/******************************************************************************
The Klipper Library, for CA-Clipper 5.x
Copyright (c), 1994, Wallace Information Systems Engineering
FUNCTION:
_AppxEqual(nNum1, nNum2, nDec) --> lIsAppxEqual
PARAMETERS:
nNum1: number to compare to nNum2
nNum2: number to compare to nNum1
nDecs: number of decimal places to compare.
SHORT:
Determine floating point equality to a given decimal place.
DESCRIPTION:
_AppxEqual() determines if two floating point values are equal WITHIN the
given number of decimal places. This is a very common operation when dealing
with comparisons of floating point numbers.
The function is useful when trying to find an acceptable equality between two
floating point numbers when they can never be exactly equal (thus foiling
any use of the "=" operator).
NOTE:
EXAMPLE:
nNum1 = 3.141592654
nNum2 = 3.141592655
? _AppxEqual(nNum1, nNum2, 9)
FALSE the numbers are not equal to nine decimal places.
? _AppxEqual(nNum1, nNum2, 8)
However, they are equal to eight decimals places, so the return value is
TRUE.
******************************************************************************/